package com.elangzhi.ssm.model;

import com.elangzhi.ssm.model.base.BaseModel;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ImageBanner extends BaseModel {

    private Long id;

    private String title;

    private String img;

    private Integer type;

    private String info;

    private Date beginTime;

    private Date endTime;

    private Integer sort;

    public ImageBanner(Long id, String title, String img, Integer type, String info, Date beginTime, Date endTime, Integer sort) {
        this.id = id;
        this.title = title;
        this.img = img;
        this.type = type;
        this.info = info;
        this.beginTime = beginTime;
        this.endTime = endTime;
        this.sort = sort;
    }

    public ImageBanner() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Date getBeginTime() {
        return beginTime;
    }


    public String getBeginTime(String pattern) {
        if(beginTime == null){ return ""; }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.format(beginTime);
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }


    public String getEndTime(String pattern) {
        if(endTime == null){ return ""; }
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        return simpleDateFormat.format(endTime);
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
}